set( LINUX_SOURCES
    ../ActivateContainerRequest.cpp
    ../ActivateContainerReply.cpp
    ../DeactivateContainerRequest.cpp
    ../ContainerOperationReply.cpp
    ../ComHostingSettingsResult.cpp
    ../RegisterContainerActivatorServiceRequest.cpp
    ../RegisterContainerActivatorServiceReply.cpp
    ../ContainerActivatorServiceAgent.cpp
    ../ContainerActivatorServiceConfig.cpp
    ../InvokeContainerApiRequest.cpp
    ../InvokeContainerApiReply.cpp
    ../ActivateCodePackageReply.cpp
    ../ActivateCodePackageRequest.cpp
    ../ActivateHostedServiceRequest.cpp
    ../ActivateProcessReply.cpp
    ../ActivateProcessRequest.cpp
    ../Activator.cpp
    ../ActivatorRequestor.cpp
    ../Application.cpp
    ../ApplicationEnvironmentContext.cpp
    ../ApplicationHostActivationTable.cpp
    ../ApplicationHostContainer.cpp
    ../ApplicationHostContext.cpp
    ../ApplicationHost.cpp
    ../ApplicationHostIsolationContext.cpp
    ../ApplicationHostManager.cpp
    ../GuestServiceTypeHostManager.cpp
    ../ApplicationHostProxy.cpp
    ../ApplicationHostRegistration.cpp
    ../ApplicationHostRegistrationStatus.cpp
    ../ApplicationHostRegistrationTable.cpp
    ../ApplicationHostType.cpp
    ../ApplicationManager.cpp
    ../ApplicationMap.cpp
    ../ApplicationPrincipals.cpp
    ../ApplicationService.cpp
    ../ApplicationServiceMap.cpp
    ../AssignIpAddressesReply.cpp
    ../AssignIpAddressesRequest.cpp
    ../BuiltinServiceAccount.cpp
    ../CertificateAccessDescription.cpp
    ../CertificateAclingManager.cpp
    ../CleanupApplicationPrincipalsReply.cpp
    ../CleanupSecurityPrincipalRequest.cpp
    ../ClearContainerHelper.cpp
    ../CodePackageActivationContext.cpp
    ../CodePackageActivationId.cpp
    ../CodePackageContext.cpp
    ../CodePackage.cpp
    ../CodePackageInstance.cpp
    ../CodePackageRuntimeInformation.cpp
    ../CodePackageTerminationNotificationRequest.cpp
    ../ComCodePackageActivationContext.cpp
    ../ComCodePackage.cpp
    ../ComConfigPackage.cpp
    ../ComDataPackage.cpp
    ../ComFabricNodeContextResult.cpp
    ../ComFabricRuntime.cpp
    ../ComProxyCodePackageHost.cpp
    ../ComProxyStatefulServiceFactory.cpp
    ../ComProxyStatelessServiceFactory.cpp
    ../ConfigureCertificateACLsRequest.cpp
    ../ConfigureCrashDumpReply.cpp
    ../ConfigureCrashDumpRequest.cpp
    ../ConfigureEndpointBindingAndFirewallPolicyRequest.cpp
    ../ConfigureContainerCertificateExportRequest.cpp
    ../CleanupContainerCertificateExportRequest.cpp
    ../ConfigureContainerCertificateExportReply.cpp
    ../ConfigureEndpointSecurityRequest.cpp
    ../ConfigureNodeForDnsService.cpp
    ../ConfigureNodeForDnsServiceRequest.cpp
    ../ConfigureSecurityPrincipalReply.cpp
    ../ConfigureSecurityPrincipalRequest.cpp
    ../ConfigureSharedFolderACLRequest.cpp
    ../ConfigureSMBShareRequest.cpp
    ../Constants.cpp
    ../ContainerEventTracker.cpp
    ../ContainerActivator.cpp
    ../ContainerApiResult.cpp
    ../ContainerEventConfig.cpp
    ../ContainerConfig.cpp
    ../ContainerConfigHelper.cpp
    ../VolumeMapper.cpp
    ../ContainerHelper.cpp
    ../ContainerHostConfig.cpp
    ../ContainerLogDriverConfig.cpp
    ../ContainerStats.cpp
    ../ContainerNetworkOperations.cpp
    ../CrashDumpConfigurationManager.cpp
    ../CrashDumpProvider.cpp
    ../CreateSymbolicLinkRequest.cpp
    ../ApplicationHostCodePackageOperationRequest.cpp
    ../ApplicationHostCodePackageOperationReply.cpp
    ../ApplicationHostCodePackageActivator.cpp
    ../SingleCodePackageApplicationHostCodePackageActivator.cpp
    ../InProcessApplicationHostCodePackageActivator.cpp
    ../ComApplicationHostCodePackageActivator.cpp
    ../ComGuestServiceCodePackageActivationManager.cpp
    ../CodePackageEventNotificationRequest.cpp
    ../CodePackageEventNotificationReply.cpp
    ../DeactivateCodePackageReply.cpp
    ../DeactivateCodePackageRequest.cpp
    ../DeactivateHostedServiceRequest.cpp
    ../DeactivateProcessReply.cpp
    ../DeactivateProcessRequest.cpp
    ../Deactivator.cpp
    ../DeleteFolderRequest.cpp
    ../DeleteApplicationFoldersReply.cpp
    ../DeleteContainerImagesRequest.cpp
    ../DeletionManager.cpp
    ../DisableNodeRequest.cpp
    ../DomainUser.cpp
    ../DockerProcessManager.cpp
    ../DockerProcessTerminatedNotification.cpp
    ../DockerUtilities.cpp
    ../DownloadContainerImagesRequest.cpp
    ../ImageCacheManager.cpp
    ../DownloadManager.cpp
    ../DnsServiceEnvironmentManager.cpp
    ../EnableNodeRequest.cpp
    ../EndpointCertificateBinding.cpp
    ../EndpointProvider.cpp
    ../EndpointResource.cpp
    ../EnvironmentManager.cpp
    ../EnvironmentResource.cpp
    ../EventDispatcher.cpp
    ../FabricActivationManager.cpp
    ../FabricActivatorClient.cpp
    ../FabricHostConfig.cpp
    ../FabricHostOperationReply.cpp
    ../FabricNodeContext.cpp
    ../FabricNodeContextResult.cpp
    ../FabricRestartManager.cpp
    ../FabricRuntimeContext.cpp
    ../FabricRuntimeImpl.cpp
    ../FabricRuntimeManager.cpp
    ../FabricUpgradeImpl.cpp
    ../FabricUpgradeManager.cpp
    ../FabricUpgradeRequest.cpp
    ../FinishRegisterApplicationHostReply.cpp
    ../FinishRegisterApplicationHostRequest.cpp
    ../FirewallSecurityProvider.cpp
    ../GetFabricProcessSidReply.cpp
    ../GetNetworkDeployedPackagesRequest.cpp
    ../GetNetworkDeployedPackagesReply.cpp
    ../GetDeployedNetworksRequest.cpp
    ../GetDeployedNetworksReply.cpp
    ../HostedServiceActivationManager.cpp
    ../HostedService.cpp
    ../HostedServiceInstance.cpp
    ../HostedServiceMap.cpp
    ../HostedServiceParameters.cpp
    ../HostingConfig.cpp
    ../HostingHealthManager.cpp
    ../HostingQueryManager.cpp
    ../HostingSubsystem.cpp
    ../HostingTraces.cpp
    ../HttpEndpointSecurityProvider.cpp
    ../InvalidLeaseReplyBody.cpp
    ../IPAddressProvider.cpp
    ../IPHelper.cpp
    ../IPAM.cpp
    ../IPAMLinux.cpp
    ../FlatIPConfiguration.cpp
    ../ReservationManager.cpp
    ../LeaseMonitor.cpp
    ../LocalUser.cpp
    ../LogCollectionProviderFactory.cpp
    ../MACHelper.cpp
    ../ManageOverlayNetworkAction.cpp
    ../ManageOverlayNetworkResourcesReply.cpp 
    ../ManageOverlayNetworkResourcesRequest.cpp
    ../MultiCodePackageApplicationHost.cpp
    ../MultiCodePackageApplicationHostProxy.cpp
    ../NatIPAM.cpp
    ../NatIpAddressProvider.cpp
    ../NetworkConfig.cpp
    ../NetworkIPAM.cpp
    ../NetworkIPAMConfig.cpp
    ../NetworkPluginProcessManager.cpp
    ../NetworkContextType.cpp
    ../NetworkInventoryAgent.cpp
    ../NetworkPluginProcessManager.cpp
    ../NodeDisabledNotification.cpp
    ../NodeEnabledNotification.cpp
    ../NodeEnvironmentManager.cpp
    ../NodeHostClosedEventArgs.cpp
    ../NodeRestartManagerClient.cpp
    ../NonActivatedApplicationHost.cpp
    ../OperationStatus.cpp
    ../OperationStatusMap.cpp
    ../OverlayNetworkRoutingInformation.cpp
    ../OverlayNetworkContainerParameters.cpp
    ../OverlayNetworkDefinition.cpp
    ../OverlayNetworkPluginOperationsLinux.cpp
    ../OverlayNetworkPlugin.cpp
    ../OverlayNetworkDriver.cpp
    ../OverlayNetworkManager.cpp
    ../OverlayNetworkResource.cpp
    ../OverlayNetworkRoute.cpp
    ../OverlayNetworkResourceProvider.cpp
    ../OverlayNetworkReservationManager.cpp
    ../OverlayIPAM.cpp
    ../PendingOperationMap.cpp
    ../PortAclMap.cpp
    ../PortAclRef.cpp
    ../portcertref.cpp
    ../PrincipalsProviderContext.cpp
    ../PrincipalsProvider.cpp
    ../ProcessActivationContext.Linux.cpp
    ../ProcessActivationManager.cpp
    ../ProcessActivator.Linux.cpp
    ../ProcessConsoleRedirector.Linux.cpp
    ../RegisterFabricActivatorClientReply.cpp
    ../RegisterFabricActivatorClientRequest.cpp
    ../RegisterFabricRuntimeReply.cpp
    ../RegisterFabricRuntimeRequest.cpp
    ../RegisterServiceTypeReply.cpp
    ../RegisterServiceTypeRequest.cpp
    ../RepositoryAuthConfig.cpp
    ../RunAsConfig.cpp
    ../RuntimeRegistration.cpp
    ../RuntimeRegistrationTable.cpp
    ../RuntimeSharingHelper.cpp
    ../SecurityGroup.cpp
    ../SecurityIdentityMap.cpp
    ../SecurityPrincipalHelper.cpp
    ../SecurityPrincipalInformation.cpp
    ../SecurityPrincipalsProvider.cpp
    ../SecurityUser.cpp
    ../ServiceAccount.cpp
    ../ServiceFactoryManager.cpp
    ../ServiceFactoryRegistration.cpp
    ../ServiceFactoryRegistrationTable.cpp
    ../ServicePackageContext.cpp
    ../ServicePackage.cpp
    ../ServicePackageEnvironmentContext.cpp
    ../ServicePackageMap.cpp
    ../ServicePackageOperation.cpp
    ../ServicePackageInstanceOperation.cpp
    ../ContainerHealthCheckStatusChangeNotification.cpp
    ../ServiceTerminatedNotification.cpp
    ../ServiceTypeState.cpp
    ../ServiceTypeStateManager.cpp
    ../ServiceTypeStatus.cpp
    ../HostingHelpers.cpp
    ../ComDummyReplicator.cpp
    ../SetupConfig.cpp
    ../SetupContainerGroupRequest.cpp
    ../ComGuestServiceInstance.cpp
    ../ComGuestServiceReplica.cpp
    ../ComStatelessGuestServiceTypeFactory.cpp
    ../ComStatefulGuestServiceTypeFactory.cpp
    ../GuestServiceTypeHost.cpp
    ../SingleCodePackageApplicationHost.cpp
    ../InProcessApplicationHost.cpp
    ../SingleCodePackageApplicationHostProxy.cpp
    ../InProcessApplicationHostProxy.cpp
    ../StartRegisterApplicationHostReply.cpp
    ../StartRegisterApplicationHostRequest.cpp
    ../stdafx.cpp
    ../TraceSessionManager.cpp
    ../TokenSecurityAccount.cpp
    ../UnregisterApplicationHostReply.cpp
    ../UnregisterApplicationHostRequest.cpp
    ../UnregisterFabricRuntimeReply.cpp
    ../UnregisterFabricRuntimeRequest.cpp
    ../UpdateCodePackageContextReply.cpp
    ../UpdateCodePackageContextRequest.cpp
    ../UpdateOverlayNetworkRoutesRequest.cpp
    ../UpdateOverlayNetworkRoutesReply.cpp
    ../VersionedApplication.cpp
    ../VersionedServicePackage.cpp
    ../LocalResourceManager.cpp
    ../LocalSecretServiceManager.cpp
    ../HostingHelper.cpp
    ../LocalResourceManager.cpp
    ../ContainerInfoReply.cpp
    ../GetContainerInfoReply.cpp
    ../GetContainerInfoRequest.cpp
    ../GetImagesReply.cpp
    ../NodeAvailableImages.cpp
    )

set( LINUX_SOURCES_CRI
    ../ContainerRuntimeHandler.cpp
    ../cri-api.grpc.pb.cc
    ../cri-api.pb.cc
   )

include_directories("..")

set(Casablanca_LIBRARY ${LIB}cpprest)
set(Casablanca_LIBRARIES ${Casablanca_LIBRARY} ${Boost_LIBRARIES} ${Boost_FRAMEWORK})

add_library(objects_Hosting2 OBJECT ${LINUX_SOURCES})
add_library(objects_Hosting2_CRI OBJECT ${LINUX_SOURCES_CRI})

add_precompiled_header(objects_Hosting2 ../stdafx.h)

add_library(${lib_Hosting2} STATIC $<TARGET_OBJECTS:objects_Hosting2> $<TARGET_OBJECTS:objects_Hosting2_CRI>)

target_link_libraries( ${lib_Hosting2}
    ${Casablanca_LIBRARIES} grpcxx_reflection grpcxx grpc protobuf gpr ares ssl crypto cgroup ${lib_ResourceMonitorConfig}
    )

set_target_properties(${lib_Hosting2} PROPERTIES
    ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_DIR})

